home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / internet / uucoder / form1.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-06-13  |  5.6 KB  |  205 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    Caption         =   "UUCODER.VBX Demo"
  4.    ClientHeight    =   4020
  5.    ClientLeft      =   1050
  6.    ClientTop       =   825
  7.    ClientWidth     =   7365
  8.    Height          =   4425
  9.    Left            =   990
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   4020
  12.    ScaleWidth      =   7365
  13.    Top             =   480
  14.    Width           =   7485
  15.    Begin Frame Frame1 
  16.       Caption         =   "Events"
  17.       Height          =   1935
  18.       Left            =   2400
  19.       TabIndex        =   12
  20.       Top             =   1680
  21.       Width           =   4815
  22.       Begin ListBox Events 
  23.          Height          =   1395
  24.          Left            =   120
  25.          TabIndex        =   13
  26.          Top             =   360
  27.          Width           =   4575
  28.       End
  29.    End
  30.    Begin TextBox LinesPerFile 
  31.       Height          =   375
  32.       Left            =   3960
  33.       TabIndex        =   5
  34.       Text            =   "950"
  35.       Top             =   960
  36.       Width           =   1455
  37.    End
  38.    Begin Frame T 
  39.       Caption         =   "Type"
  40.       Height          =   1455
  41.       Left            =   240
  42.       TabIndex        =   10
  43.       Top             =   960
  44.       Width           =   1575
  45.       Begin OptionButton opt_Auto 
  46.          Caption         =   "Auto Detect"
  47.          Height          =   255
  48.          Left            =   120
  49.          TabIndex        =   4
  50.          Top             =   1080
  51.          Value           =   -1  'True
  52.          Width           =   1335
  53.       End
  54.       Begin OptionButton opt_xx 
  55.          Caption         =   "XX"
  56.          Height          =   255
  57.          Left            =   120
  58.          TabIndex        =   3
  59.          Top             =   720
  60.          Width           =   1335
  61.       End
  62.       Begin OptionButton Opt_UU 
  63.          Caption         =   "UU"
  64.          Height          =   255
  65.          Left            =   120
  66.          TabIndex        =   2
  67.          Top             =   360
  68.          Width           =   1335
  69.       End
  70.    End
  71.    Begin TextBox OutFile 
  72.       Height          =   375
  73.       Left            =   4560
  74.       TabIndex        =   1
  75.       Top             =   240
  76.       Width           =   2055
  77.    End
  78.    Begin CommandButton cmd_Decode 
  79.       Caption         =   "Decode"
  80.       Height          =   495
  81.       Left            =   240
  82.       TabIndex        =   7
  83.       Top             =   3240
  84.       Width           =   1575
  85.    End
  86.    Begin UUCoder UUCoder1 
  87.       InFile          =   ""
  88.       Left            =   600
  89.       LinesPerFile    =   950
  90.       Open            =   0   'False
  91.       OutFile         =   ""
  92.       Result          =   0
  93.       Top             =   2040
  94.       Type            =   2  'AutoDetect
  95.    End
  96.    Begin CommandButton cmd_Encode 
  97.       Caption         =   "Encode"
  98.       Height          =   495
  99.       Left            =   240
  100.       TabIndex        =   6
  101.       Top             =   2640
  102.       Width           =   1575
  103.    End
  104.    Begin TextBox InFile 
  105.       Height          =   375
  106.       Left            =   1320
  107.       TabIndex        =   0
  108.       Top             =   240
  109.       Width           =   2055
  110.    End
  111.    Begin Label Lin 
  112.       Caption         =   "Lines Per File"
  113.       Height          =   255
  114.       Left            =   2400
  115.       TabIndex        =   11
  116.       Top             =   960
  117.       Width           =   1335
  118.    End
  119.    Begin Label Label2 
  120.       Caption         =   "OutFile:"
  121.       Height          =   255
  122.       Left            =   3600
  123.       TabIndex        =   9
  124.       Top             =   240
  125.       Width           =   735
  126.    End
  127.    Begin Label Label1 
  128.       Caption         =   "InFile:"
  129.       Height          =   255
  130.       Left            =   240
  131.       TabIndex        =   8
  132.       Top             =   240
  133.       Width           =   735
  134.    End
  135. Option Explicit
  136. Sub cmd_Decode_Click ()
  137.   Events.Clear
  138.   uucoder1.InFile = Trim$(InFile)
  139.   If Opt_uu.Value = True Then
  140.      uucoder1.Type = 0
  141.   End If
  142.   If Opt_xx.Value = True Then
  143.      uucoder1.Type = 1
  144.   End If
  145.   If Opt_Auto.Value = True Then
  146.      uucoder1.Type = 2
  147.   End If
  148.   uucoder1.Action = 0   ' decode
  149.   Select Case uucoder1.Result
  150.     Case 20000
  151.        MsgBox "Invalid Action specified"
  152.     Case 20001
  153.        MsgBox "Error opening a File"
  154.     Case 20002
  155.        MsgBox "Nothing to do. Input file has no begin"
  156.     Case 20003
  157.        MsgBox "File Decoded OK"
  158.     Case 20004
  159.        MsgBox "File not found"
  160.     Case 20005
  161.        MsgBox "Input file not specified"
  162.   End Select
  163. End Sub
  164. Sub cmd_Encode_Click ()
  165.   Events.Clear
  166.   uucoder1.InFile = Trim$(InFile)
  167.   uucoder1.OutFile = Trim$(OutFile)
  168.   uucoder1.LinesPerFile = Val(LinesPerFile)
  169.   If Opt_xx.Value = True Then
  170.      uucoder1.Type = 1
  171.   Else
  172.      uucoder1.Type = 0
  173.   End If
  174.   uucoder1.Action = 1   ' encode
  175.   Select Case uucoder1.Result
  176.     Case 20000
  177.        MsgBox "Invalid Action specified"
  178.     Case 20001
  179.        MsgBox "Error opening a File"
  180.     Case 20002
  181.        MsgBox "Nothing to do"
  182.     Case 20003
  183.        MsgBox "File Encoded OK"
  184.     Case 20004
  185.        MsgBox "File not found"
  186.     Case 20005
  187.        MsgBox "Input file not specified"
  188.   End Select
  189. End Sub
  190. Sub UUCoder1_Message (MsgNum As Integer, Msg As String)
  191.   Dim Message As String
  192.   Select Case MsgNum
  193.      Case 1
  194.        Message = "Creating " & Msg
  195.      Case 2
  196.        Message = "Could not find next input file " & Msg & " please suply it by modify Msg"
  197.      Case 3
  198.        Message = "Encoded data to " & Msg
  199.      Case 4
  200.        Message = "Decoing data from " & Msg
  201.   End Select
  202.   Events.AddItem Message
  203.   DoEvents
  204. End Sub
  205.